<template>
  <div class="home-view">
    <div class="my-swiper-area">
      <van-swipe :autoplay="3000" indicator-color="#90c0ef">
        <van-swipe-item v-for="(image,index) in images" :key="index">
          <img :src="image" />
        </van-swipe-item>
      </van-swipe>
    </div>
    <van-cell-group>
      <van-cell title="青年汇店" value="距您53m" icon="location-o" center>
        <!-- <template #right-icon>
          <van-switch v-model="checked"/>
        </template>-->
      </van-cell>
      <van-cell title="现在下单" label="ORDER NOW" center to="/menu">
        <template #default>
          <van-image width="20px" height="20px" fit="contain" :src="coffee" />
        </template>
      </van-cell>
      <van-cell title="咖啡钱包" label="COFFRR WALLET" center>
        <template #default>
          <van-image width="20px" height="20px" fit="contain" :src="wallet" />
        </template>
      </van-cell>
      <van-cell title="送Ta咖啡" label="SEND COFFEE" center>
        <template #default>
          <van-image width="20px" height="20px" fit="contain" :src="gift" />
        </template>
      </van-cell>
      <van-cell title="企业账户" label="ENTERPRISE ACCOUNT" center>
        <template #default>
          <van-image width="20px" height="20px" fit="contain" :src="count" />
        </template>
      </van-cell>
    </van-cell-group>
    <!-- <div class="adv">
      <img :src="homeAdv" />
    </div>-->
  </div>
</template>

<script>
import homeSwiper1 from "./../assets/home-swiper-1.jpg";
import homeSwiper2 from "./../assets/home-swiper-3.jpg";
import homeSwiper3 from "./../assets/home-swiper-3.jpg";
import homeAdv from "./../assets/home-adv.png";
import coffee from "@/assets/home/coffee.svg";
import count from "@/assets/home/count.svg";
import gift from "@/assets/home/gift.svg";
import wallet from "@/assets/home/wallet.svg";
export default {
  name: "Home",
  data() {
    return {
      images: [homeSwiper1, homeSwiper2, homeSwiper3],
      homeAdv,
      coffee,
      count,
      gift,
      wallet,
      checked: true
    };
  },
  mounted() {
    this.getAddressPos();
  },
  methods: {
    getAddressPos() {
      this.$toast.loading({
        message: "加载中...",
        forbidClick: true,
        duration: 1000
      });
    }
  },
};
</script>

<style lang='less'>
.my-swiper-area {
  img {
    width: 100%;
    height: 100%;
  }
}
.home-view {
  .van-cell-group {
    margin-top: 5px;
    .van-image {
      border: 1px solid #63473a;
      padding: 8px;
      border-radius: 50%;
    }
  }
}
.adv {
  height: 55px;
  margin: auto;
  padding: 0 14px;
  img {
    width: 100%;
  }
}
</style>